package cz.spock.parser.util;

import java.util.Comparator;

import cz.spock.parser.entity.TripletPattern;

/**
 * Compares TripletPattern objects according to their weight.
 * "Heavier" objects are "smaller" - should be on lower indexes of list
 * 
 * Note: this comparator imposes orderings that are inconsistent with equals.
 * 
 * @author miso
 *
 */
public class TripletPatternComparator implements Comparator<TripletPattern> {

    @Override
    public int compare(TripletPattern o1, TripletPattern o2) {
        return o2.getWeight() - o1.getWeight();
    }

}
